﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PlaceHR.Processor.Processor.Salary.Steps
{
    class BasicSalaryStepCalculator : StepCalculatorBase<SalaryProcessorContext, EmployeeSalary>
    {
        public override void Calculate(SalaryProcessorContext salaryProcessorContext, EmployeeSalary employeeSalary)
        {
            var contractInfo = salaryProcessorContext.CurrentEmployee.ContractInfo.FirstOrDefault();
            if (contractInfo == null)
            {
                return;
            }

            employeeSalary.BasicSalary = contractInfo.BasicSalary;
            employeeSalary.PositionSalary = contractInfo.PositionSalary;
            employeeSalary.ExpatAllowance = contractInfo.ExpatAllowance;
            employeeSalary.StaffWelfareFee = salaryProcessorContext.StaffWelfareFee;
        }

    }
}
